import request from '@/utils/request'

// 获取借阅列表
export function getBorrowList(params) {
  return request({
    url: '/borrow/list',
    method: 'get',
    params
  })
}

// 借书
export function borrowBook(data) {
  return request({
    url: '/borrow/borrow',
    method: 'post',
    data
  })
}

// 还书
export function returnBook(data) {
  return request({
    url: '/borrow/return',
    method: 'post',
    data
  })
}

// 续借
export function renewBook(data) {
  return request({
    url: '/borrow/renew',
    method: 'post',
    data
  })
}

// 根据用户ID获取借阅记录
export function getBorrowByUserId(userId, params) {
  return request({
    url: `/borrow/user/${userId}`,
    method: 'get',
    params
  })
}

// 更新借阅状态
export function updateBorrowStatus() {
  return request({
    url: '/borrow/update-status',
    method: 'post'
  })
} 